<template>
  <div class="container">
    <div class="grid-item" v-for="(item, index) in items" :key="index">
      <h3>{{ item.title }}</h3>
      <p>{{ item.description }}</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      items: [
        { title: "期刊1", description: "期刊1的描述" },
        { title: "期刊2", description: "期刊2的描述" },
        { title: "期刊3", description: "期刊3的描述" },
        { title: "期刊4", description: "期刊4的描述" },
        { title: "期刊5", description: "期刊5的描述" },
        { title: "期刊6", description: "期刊6的描述" },
        { title: "期刊7", description: "期刊7的描述" },
        { title: "期刊8", description: "期刊8的描述" },
        { title: "期刊9", description: "期刊9的描述" },
      ],
    };
  },
};
</script>

<style scoped>
.container {
  //display: flex;
  flex-wrap: wrap;
  justify-content: center;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 三列 */
  gap: 10px; /* 间距 */
}

.grid-item {
  width: calc(20% - 20px);
  height: 40%;
  margin: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.grid-item h3 {
  font-size: 18px;
  margin: 10px;
}

.grid-item p {
  font-size: 14px;
  color: #666;
  margin: 10px;
}
</style>
